<template>
<div class="vue-box sbot">
  <!-- ------- 内容部分 ------- -->
  <div class="c-panel">
    <el-form v-if="m" :inline="true">
      <sa-info name="序号" br>{{ m.id }}</sa-info>
      <sa-info type="text" name="资源名" :value="m.name" br></sa-info>
      <sa-info type="text" name="识别码" :value="m.code" br></sa-info>
      <sa-info type="enum" name="资源类型" :jv="dims.ADS_TYPE" :value="m.type" br />
      <sa-info name="广告位" br>
        <template>
          <el-tag effect="plain" type="primary" v-for="(ads, index) in adsSpace" :key="index" v-if="ads.id === m.spaceId">
            {{ ads.name }}
          </el-tag>
        </template>
      </sa-info>
      <sa-info type="link" name="广告URL" :value="m.url" br />
      <sa-info type="img" name="商家LOGO" :value="m.img" br />
      <sa-info type="img-list" name="广告图" :value="m.thumbnail" br />
      <sa-info name="开始日期" br>
        <template>
          {{ m.startDate }} ~ {{ m.startDate }}
        </template>
      </sa-info>
      <sa-info type="enum" name="审核状态" :jv="dims.AUDIT_STATUS" :value="m.auditStatus" br />
      <sa-info type="enum" name="启用状态" :jv="dims.YES_OR_NO" :value="m.status" br />
      <sa-info name="描述" br>{{ m.note }}</sa-info>
    </el-form>
  </div>
</div>
</template>

<script>
export default {
  name: 'ads-info',
  props: {
    param: Object
  },
  data() {
    return {
      id: this.param.id,
      dims: this.param.dims,
      sa: sa,
      m: {},
      adsSpace: this.param.adsSpace,
    }
  },
  created: function () {
    sa.ajax('/ads/getById', {
      id: this.id
    }, function (res) {
      this.m = res.data;
    }.bind(this), {
      type: "get"
    });
  },
  methods: {}
}
</script>

<style scoped>
.c-panel>>>.c-title {
  margin-bottom: 20px;
}

.c-panel>>>.c-item .c-label {
  width: 150px;
}

.c-panel>>>.c-item .el-input {
  width: 300px;
}

/* 链接样式  */
/*.my-link{position: relative; top: -1px; margin-left: 0.5em;}*/
</style>
